import 'package:flutter/material.dart';

abstract class RenderBase extends StatelessWidget {
  int count;
  late List<int> pages;

  RenderBase({super.key, this.count = 15}) {
    pages = List.generate(count, (index) => index);
  }

  @override
  Widget build(BuildContext context) {
    final timemill = DateTime.now().millisecond;
    WidgetsBinding.instance.addPostFrameCallback((_) {
      print(
          "$this count=$count, cost time ${DateTime.now().millisecond - timemill}ms");
    });

    return Scaffold(
      appBar: AppBar(title: const Text("Render Container")),
      // body: ListView.builder(
      //   itemCount: pages.length,
      //   itemBuilder: (context, index) => buildItem(context, index),
      // ),
      body: SingleChildScrollView(
        child: Column(
          children: List.generate(count, (index) => buildItem(context, index)),
        ),
      ),
    );
  }

  buildItem(BuildContext context, int index);
}
